<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MNNKit: com.alibaba.android.mnnkit.actor.PortraitSegmentor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="mnn.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MNNKit
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">MNNKit is a collection of AI solutions on mobile phone, powered by MNN engine.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacecom.html">com</a></li><li class="navelem"><a class="el" href="namespacecom_1_1alibaba.html">alibaba</a></li><li class="navelem"><a class="el" href="namespacecom_1_1alibaba_1_1android.html">android</a></li><li class="navelem"><a class="el" href="namespacecom_1_1alibaba_1_1android_1_1mnnkit.html">mnnkit</a></li><li class="navelem"><a class="el" href="namespacecom_1_1alibaba_1_1android_1_1mnnkit_1_1actor.html">actor</a></li><li class="navelem"><a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.html">PortraitSegmentor</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pac-static-methods">Static Package Functions</a> &#124;
<a href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">com.alibaba.android.mnnkit.actor.PortraitSegmentor Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for com.alibaba.android.mnnkit.actor.PortraitSegmentor:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.png" usemap="#com.alibaba.android.mnnkit.actor.PortraitSegmentor_map" alt=""/>
  <map id="com.alibaba.android.mnnkit.actor.PortraitSegmentor_map" name="com.alibaba.android.mnnkit.actor.PortraitSegmentor_map">
<area href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor.html" alt="com.alibaba.android.mnnkit.actor.MNNKitBaseActor" shape="rect" coords="0,0,305,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af8db80ff72305e2a03467558c8eb789f"><td class="memItemLeft" align="right" valign="top">synchronized float[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.html#af8db80ff72305e2a03467558c8eb789f">inference</a> (byte[] data, int width, int height, <a class="el" href="enumcom_1_1alibaba_1_1android_1_1mnnkit_1_1entity_1_1_m_n_n_c_v_image_format.html">MNNCVImageFormat</a> format, int inAngle, <a class="el" href="enumcom_1_1alibaba_1_1android_1_1mnnkit_1_1entity_1_1_m_n_n_flip_type.html">MNNFlipType</a> flipType)</td></tr>
<tr class="separator:af8db80ff72305e2a03467558c8eb789f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab14ee106cf21ff04f3aab298cb70af66"><td class="memItemLeft" align="right" valign="top">synchronized float[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.html#ab14ee106cf21ff04f3aab298cb70af66">inference</a> (Bitmap bitmap, <a class="el" href="enumcom_1_1alibaba_1_1android_1_1mnnkit_1_1entity_1_1_m_n_n_flip_type.html">MNNFlipType</a> flipType)</td></tr>
<tr class="separator:ab14ee106cf21ff04f3aab298cb70af66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b4ea3db2cd5732b8dcb238665bd1bb3"><td class="memItemLeft" align="right" valign="top">synchronized void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.html#a4b4ea3db2cd5732b8dcb238665bd1bb3">release</a> ()</td></tr>
<tr class="separator:a4b4ea3db2cd5732b8dcb238665bd1bb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a6eb20700bc34783d6eaae95cfe0324b7"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.html#a6eb20700bc34783d6eaae95cfe0324b7">createInstanceAsync</a> (Context context, <a class="el" href="interfacecom_1_1alibaba_1_1android_1_1mnnkit_1_1intf_1_1_instance_created_listener.html">InstanceCreatedListener</a>&lt; <a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.html">PortraitSegmentor</a> &gt; listener)</td></tr>
<tr class="separator:a6eb20700bc34783d6eaae95cfe0324b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pac-static-methods"></a>
Static Package Functions</h2></td></tr>
<tr class="memitem:ac8b2b7f862c0f6d51a3c2c0c4b38714d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.html#ac8b2b7f862c0f6d51a3c2c0c4b38714d">[static initializer]</a></td></tr>
<tr class="separator:ac8b2b7f862c0f6d51a3c2c0c4b38714d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_static_methods_classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor"><td colspan="2" onclick="javascript:toggleInherit('pro_static_methods_classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor')"><img src="closed.png" alt="-"/>&#160;Static Protected Member Functions inherited from <a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor.html">com.alibaba.android.mnnkit.actor.MNNKitBaseActor</a></td></tr>
<tr class="memitem:a162f5e6abf6df07000d56fad49975438 inherit pro_static_methods_classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor"><td class="memItemLeft" align="right" valign="top">static boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor.html#a162f5e6abf6df07000d56fad49975438">isBaseNativeLibAvailable</a> ()</td></tr>
<tr class="separator:a162f5e6abf6df07000d56fad49975438 inherit pro_static_methods_classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80c616582f8cb54bb4d5b8ea9f152b2b inherit pro_static_methods_classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor"><td class="memItemLeft" align="right" valign="top">static String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor.html#a80c616582f8cb54bb4d5b8ea9f152b2b">getModelCacheDir</a> (Context context, String bizName)</td></tr>
<tr class="separator:a80c616582f8cb54bb4d5b8ea9f152b2b inherit pro_static_methods_classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Portrait Segmentor Class </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ac8b2b7f862c0f6d51a3c2c0c4b38714d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac8b2b7f862c0f6d51a3c2c0c4b38714d">&#9670;&nbsp;</a></span>[static initializer]()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">com.alibaba.android.mnnkit.actor.PortraitSegmentor.[static initializer]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">package</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reimplemented from <a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor.html#aafb34164c58d6db3acc9ef6889b4baf9">com.alibaba.android.mnnkit.actor.MNNKitBaseActor</a>.</p>

</div>
</div>
<a id="a6eb20700bc34783d6eaae95cfe0324b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6eb20700bc34783d6eaae95cfe0324b7">&#9670;&nbsp;</a></span>createInstanceAsync()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void com.alibaba.android.mnnkit.actor.PortraitSegmentor.createInstanceAsync </td>
          <td>(</td>
          <td class="paramtype">Context&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="interfacecom_1_1alibaba_1_1android_1_1mnnkit_1_1intf_1_1_instance_created_listener.html">InstanceCreatedListener</a>&lt; <a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_portrait_segmentor.html">PortraitSegmentor</a> &gt;&#160;</td>
          <td class="paramname"><em>listener</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>create portrait segmentor instance asynchronously, call back in in main thread. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>context </td></tr>
    <tr><td class="paramname">listener</td><td>instance created listener, see also InstanceCreatedListener Interface </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ab14ee106cf21ff04f3aab298cb70af66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab14ee106cf21ff04f3aab298cb70af66">&#9670;&nbsp;</a></span>inference() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">synchronized float [] com.alibaba.android.mnnkit.actor.PortraitSegmentor.inference </td>
          <td>(</td>
          <td class="paramtype">Bitmap&#160;</td>
          <td class="paramname"><em>bitmap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="enumcom_1_1alibaba_1_1android_1_1mnnkit_1_1entity_1_1_m_n_n_flip_type.html">MNNFlipType</a>&#160;</td>
          <td class="paramname"><em>flipType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>inference image </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bitmap</td><td>bitmap image </td></tr>
    <tr><td class="paramname">flipType</td><td>mirror type applied on the mask: now support Y-axis flipping(FLIP_Y) only </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>216*384 mask array, value of mask array is a probability score(0.0~1.0) of inside the portrait area </dd></dl>

</div>
</div>
<a id="af8db80ff72305e2a03467558c8eb789f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af8db80ff72305e2a03467558c8eb789f">&#9670;&nbsp;</a></span>inference() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">synchronized float [] com.alibaba.android.mnnkit.actor.PortraitSegmentor.inference </td>
          <td>(</td>
          <td class="paramtype">byte[]&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="enumcom_1_1alibaba_1_1android_1_1mnnkit_1_1entity_1_1_m_n_n_c_v_image_format.html">MNNCVImageFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>inAngle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="enumcom_1_1alibaba_1_1android_1_1mnnkit_1_1entity_1_1_m_n_n_flip_type.html">MNNFlipType</a>&#160;</td>
          <td class="paramname"><em>flipType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>inference using common data input </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>input data, in byte array format </td></tr>
    <tr><td class="paramname">width</td><td>data width </td></tr>
    <tr><td class="paramname">height</td><td>data height </td></tr>
    <tr><td class="paramname">format</td><td>data format </td></tr>
    <tr><td class="paramname">inAngle</td><td>input angle, the clock-wise rotation angle applied on the input image, the portrait would be in the top-to-bottom direction after rotated. </td></tr>
    <tr><td class="paramname">flipType</td><td>mirror type applied on the mask: now support Y-axis flipping(FLIP_Y) only </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>216*384 mask array, value of mask array is a probability score(0.0~1.0) of inside the portrait area </dd></dl>

</div>
</div>
<a id="a4b4ea3db2cd5732b8dcb238665bd1bb3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b4ea3db2cd5732b8dcb238665bd1bb3">&#9670;&nbsp;</a></span>release()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">synchronized void com.alibaba.android.mnnkit.actor.PortraitSegmentor.release </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reimplemented from <a class="el" href="classcom_1_1alibaba_1_1android_1_1mnnkit_1_1actor_1_1_m_n_n_kit_base_actor.html#aa0f58f2cbf6c4c6a677d2ba9f7c8c374">com.alibaba.android.mnnkit.actor.MNNKitBaseActor</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>MNNPortraitSegmentation/android/src/main/java/com/alibaba/android/mnnkit/actor/<a class="el" href="_portrait_segmentor_8java.html">PortraitSegmentor.java</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
